/*
 * UserTestPanel.h
 *
 *  Created on: 2012-11-3
 *      Author: tutu
 */

#ifndef USERTESTPANEL_H_
#define USERTESTPANEL_H_

#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QCheckBox>
#include "../requester/TUserRequester.h"

class UserTestPanel : public QWidget
{
	Q_OBJECT

// Member
private:
	QPushButton *_listButton;
	QLineEdit *_idEdit;
	QLineEdit *_loginNameEdit;
	QLineEdit *_loginPasswordEdit;
	QLineEdit *_nameEdit;
	QLineEdit *_emailEdit;
	QLineEdit *_roleIdEdit;
	QCheckBox *_activeCheckBox;
	QPushButton *_createButton;
	QPushButton *_updateButton;
	QPushButton *_updateStatusButton;
	TUserRequesterPointer _requester;

// Method
private:
	void fillUser(TUserPointer user);
public:
	UserTestPanel(QWidget *parent = 0);
	virtual ~UserTestPanel();

// Slot
private slots:
	void listButtonClicked();
	void createButtonClicked();
	void updateButtonClicked();
	void updateStatusButtonClicked();
	void requestFinished(bool error, QList<TUserPointer> users);
	void createFinished(bool error, TUserPointer user);
	void updateFinished(bool error, TUserPointer user);
};

#endif /* USERTESTPANEL_H_ */
